<%--                                                                       --%>
<%-- Copyright (c) 2004-2005 BroadVision, Inc.  All rights reserved.       --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries. Additionally, IONA    --%>
<%-- and Orbix are trademarks of IONA Technologies, Ltd.  RSA, MD5, and    --%>
<%-- RC2 are trademarks of RSA Data Security, Inc.                         --%>
<%--                                                                       --%>

<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean-el" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

<c:set var="viewBean" value="${emSegmentViewView}" />
<c:set var="viewBeanMap" value="${viewBean.map}" />

<script language="JavaScript">
function doDelete(theForm) {
  var isDelete = confirm("<bean-el:message key="em.segment.delete.confirm" bundle="em" />");
  if (isDelete) {
    theForm.action = "<html-el:rewrite page="/em/segment/segmentDelete.do" />";
    theForm.submit();
  }
  return false;
}

</script>

<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="content area">
  <tr>
    <td valign="top" width="100%">
      <div class="pageTitle">
        <bean-el:message key="em.segment.view.page.title" bundle="em" arg0="${viewBeanMap.segmentName}"/>
      </div>
      <div class="errorMessage"><html-el:errors/></div>

      <!- place body here -->

      <c:set var="breadcrumbs" value="${viewBeanMap.breadcrumbs}" scope="request" />
      <%request.setAttribute("lastNeedLink", Boolean.TRUE);%>
      <jsp:include page="/em/segment/segmentBreadcrumbs.jsp" flush="true" />

      <html-el:form action="/em/segment/segmentEdit.do">
      <html-el:hidden name="viewBean" property="segmentOid"/>


      <div class="pageSubtitle">
        <span class="left"><bean-el:message key="em.segment.view.page.subtitle.1" bundle="em"/></span>
        <span class="right">
        <c:choose>
           <c:when test='${viewBeanMap.editType}'>
                  <input type="button" class="inputButton" value="<bean-el:message key="button.edit" bundle="em"/>" onclick="javascript:this.form.submit();">
           </c:when>
           <c:otherwise>
           </c:otherwise>
         </c:choose>

         <c:choose>
           <c:when test='${viewBeanMap.deleteType}'>
                  <input type="button" class="inputButton" value="<bean-el:message key="button.delete" bundle="em"/>"
            onclick="doDelete(this.form);">
           </c:when>
           <c:otherwise>
           </c:otherwise>
         </c:choose>

        </span>
      </div>

      </html-el:form>

      <table class="labelForm" width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="label" width="20%"><bean-el:message key="em.segment.name" bundle="em"/>:</td>
        <td class="labelField" width="80%"><c:out value="${viewBeanMap.segmentName}" /></td>
      </tr>

      <tr>
        <td class="label"><bean-el:message bundle="mc.messages" key="mc.header.description"/>:</td>
        <td class="labelField"><c:out value="${viewBeanMap.description}"/></td>
      </tr>

      <tr>
        <td class="label"><bean-el:message key="em.label.status" bundle="em"/>:</td>
        <td class="labelField">
          <c:choose>
            <c:when test="${viewBeanMap.status == 1}">
              <bean-el:message bundle="em" key="em.label.online" />
            </c:when>
            <c:otherwise>
              <bean-el:message bundle="em" key="em.label.offline" />
            </c:otherwise>
          </c:choose>
        </td>
      </tr>

      <tr>
        <td class="label"><bean-el:message key="em.segment.category" bundle="em"/>:</td>
        <td class="labelField"><c:out value="${viewBeanMap.categoryFullPath}" /></td>
      </tr>

      <tr>
        <td class="label"><bean-el:message bundle="mc.messages" key="mc.header.lastModifiedDate"/>:</td>
        <td class="labelField"><bean:write name="viewBeanMap" property="lastModifiedTime" bundle="em" formatKey="format.datetime.long"/></td>
      </tr>

      <tr>
        <td class="label"><bean-el:message bundle="em" key="em.segment.creation.date" />:</td>
        <td class="labelField"><bean:write name="viewBeanMap" property="creationTime" bundle="em" formatKey="format.datetime.long"/></td>
      </tr>

      </table>

      <div class="pageSubtitle">
        <span class="left"><bean-el:message key="em.segment.view.page.subtitle.2" bundle="em"/></span>
        <span class="right">&nbsp;</span>
      </div>

      <c:set var="conditionList" value="${viewBeanMap.conditionList}" scope="request" />
      <jsp:include page="/em/criteriabuilder/conditionListViewSection.jsp" />

    </td>
  </tr>
</table>

    </td>
  </tr>
</table>
